const $http = window.$http;

// 获取部门树
export function getDepartTree (params) {
  return $http.request({ url: "/supervise/depart/queryPage", params, });
}

// 部门新增
export function createDepart (params) {
  return $http.request({ method: 'post', url: "/supervise/depart/add", data: params, });
}

// 根据id删除部门
export function delDeparts (params) {
  return $http.request({ method: 'delete', url: `/supervise/depart/deleteBatch/${params}`, });
}

// id查询
export function getDepartById (id) {
  return $http.request({ url: `/supervise/depart/detail/${id}`, });
}

// 部门编辑
export function editDepart (params) {
  return $http.request({ method: 'put', url: "/supervise/depart/edit", data: params, });
}

// 通过父id查询部门树列表
export function getTreeByParentId (params) {
  return $http.request({ url: "/supervise/depart/queryTreeByParentId", params, });
}
